//---------------------------------------------------------------------------

#ifndef TRegistHandlerH
#define TRegistHandlerH
//---------------------------------------------------------------------------
#include <string>
#include <system.hpp>
#include "common.h"
namespace WYHGloox{
class TRegistHandler : public RegistrationHandler
{
  private:
	Registration* Register;
	TOnRegistrationFields FOnRegistrationFields;
	TOnRegistrationResult FOnRegistrationResult;
	TOnAlreadyRegistered FOnAlreadyRegistered;
	TOnDataForm FOnDataForm;
	TOnOOB FOnOOB;
	RegistrationFields userdata;
	Client* _client;
  public:
	TRegistHandler(Client *client);
	virtual ~TRegistHandler();
	void __fastcall PreparRegist();
	void __fastcall CreateUser(int fields,std::string username,std::string password);
	void __fastcall ChangePassword(std::string newpassword);
	void __fastcall RemoveUser();
	virtual void handleRegistrationFields( const JID& from, int fields, std::string instructions );
	virtual void handleRegistrationResult( const JID& from, RegistrationResult result );
	virtual void handleAlreadyRegistered( const JID& from );
	virtual void handleDataForm( const JID& from, const DataForm& form );
	virtual void handleOOB( const JID& from, const OOB& oob );
	__property TOnRegistrationFields OnRegistrationFields={read=FOnRegistrationFields,write=FOnRegistrationFields};
	__property TOnRegistrationResult OnRegistrationResult={read=FOnRegistrationResult,write=FOnRegistrationResult};
	__property TOnAlreadyRegistered OnAlreadyRegistered={read=FOnAlreadyRegistered,write=FOnAlreadyRegistered};
	__property TOnDataForm OnDataForm={read=FOnDataForm,write=FOnDataForm};
	__property TOnOOB OnOOB={read=FOnOOB,write=FOnOOB};

};

};
using namespace WYHGloox;
#endif
